Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add move option to a modal window #2547

Merged
merged 4 commits into from
May 7, 2024

Conversation

GlugovGrGlib
Copy link
Collaborator

@GlugovGrGlib GlugovGrGlib commented Apr 26, 2024

Description

Adding Move modal functionality

@PKulkoRaccoonGang
Copy link

Related FE PR

@GlugovGrGlib GlugovGrGlib force-pushed the g-glugovskiy/move_modal_window branch 2 times, most recently from 90f9205 to 6906f1e Compare May 2, 2024 10:16
@GlugovGrGlib GlugovGrGlib changed the base branch from ts-develop-17.04 to ts-develop May 2, 2024 10:17
@GlugovGrGlib GlugovGrGlib force-pushed the g-glugovskiy/move_modal_window branch 4 times, most recently from d2aeabd to 5ad8ca8 Compare May 2, 2024 10:56
cms/urls.py Outdated
@@ -146,8 +146,8 @@
name='xblock_outline_handler'),
re_path(fr'^xblock/container/{settings.USAGE_KEY_PATTERN}$', contentstore_views.xblock_container_handler,
name='xblock_container_handler'),
re_path(fr'^xblock/{settings.USAGE_KEY_PATTERN}/editor$', edit_view_xblock,
name='xblock_editor_handler'),
re_path(fr'^xblock/{settings.USAGE_KEY_PATTERN}/actions/(?P<action_name>[^/]+)$$', xblock_actions_view,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to remove $

};

xblockView.render();
require(['js/models/xblock_info', 'js/views/xblock', 'js/views/utils/xblock_utils',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to remove unused dependencies

@@ -72,8 +73,10 @@
CREATE_IF_NOT_FOUND = ["course_info"]

# Useful constants for defining predicates
NEVER = lambda x: False
ALWAYS = lambda x: True
def NEVER(x):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove formating change

@@ -208,6 +208,11 @@ function($, _, Backbone, gettext, BaseModal, ViewUtils, XBlockViewUtils, XBlockE
// Notify child views to stop listening events
Backbone.trigger('xblock:editorModalHidden');

window.parent.postMessage({
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Send message for edit

@@ -185,6 +185,10 @@ function($, Backbone, _, gettext, BaseView, XBlockViewUtils, MoveXBlockUtils, Ht
targetParentLocator: this.targetParentXBlockInfo.id
}
);
window.parent.postMessage({
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Send message for move

@GlugovGrGlib GlugovGrGlib force-pushed the g-glugovskiy/move_modal_window branch from 5ad8ca8 to b077870 Compare May 2, 2024 12:42
@GlugovGrGlib GlugovGrGlib marked this pull request as ready for review May 7, 2024 09:51
@@ -119,6 +119,10 @@ define(['jquery', 'underscore', 'gettext', 'js/views/baseview'],
event.preventDefault();
event.stopPropagation(); // Make sure parent modals don't see the click
}
window.parent.postMessage({
method: 'close_edit_modal',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message is incorrect, it should be generic for modals

@require_http_methods("GET")
@login_required
def edit_view_xblock(request, usage_key_string):
def xblock_actions_view(request, usage_key_string, action_name):
"""
The handler for rendered edit xblock view.
Copy link
Collaborator Author

@GlugovGrGlib GlugovGrGlib May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update Docstring to describe the rendering for different xblock actions

"""
Return rendered xblock action view.
The action name should be provided as an argument.
Valid options for action name are edit and move.
"""

@@ -208,6 +208,11 @@ function($, _, Backbone, gettext, BaseModal, ViewUtils, XBlockViewUtils, XBlockE
// Notify child views to stop listening events
Backbone.trigger('xblock:editorModalHidden');

window.parent.postMessage({
method: 'close_edit_modal',
msg: 'Sends a message when the modal window is closed'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update message to specifically state about edit modal

@GlugovGrGlib GlugovGrGlib merged this pull request into ts-develop May 7, 2024
62 of 64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants